home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / MicrosoftExecutionContextParser.java < prev    next >
Text File  |  1998-09-27  |  2KB  |  69 lines

  1. package com.symantec.itools.lang;
  2.  
  3.  
  4. import java.io.BufferedReader;
  5. import java.io.StringReader;
  6.  
  7.  
  8. /**
  9.  * @author Symantec Internet Tools Division
  10.  * @version 1.0
  11.  * @since VCafe 3.0
  12.  */
  13.  
  14. public class MicrosoftExecutionContextParser
  15.     extends ExecutionContextParser
  16. {
  17.     protected MicrosoftExecutionContextParser()
  18.     {
  19.     }
  20.  
  21.     /**
  22.      * @param stackTrace TODO
  23.      * @param level TODO
  24.      * @since VCafe 3.0
  25.      */
  26.     
  27.     public void parse(String stackTrace, int level)
  28.     {
  29.         BufferedReader reader;
  30.  
  31.         reader = new BufferedReader(new StringReader(stackTrace));
  32.         
  33.         // skip past
  34.         //    at com/symantec/itools/lang/Debug/getStackTrace
  35.         //    at com/symantec/itools/lang/Debug/getExecutionContext
  36.         level += 2;
  37.         
  38.         try   
  39.         {
  40.             String str;
  41.             int    i;
  42.             int    j;
  43.  
  44.             // get rid of "Throwable"
  45.             if(reader.readLine() == null)
  46.             {
  47.                 return;
  48.             }
  49.  
  50.             // remove unwanted lines
  51.             for(i = 0; i < level; i++)
  52.             {
  53.                 if(reader.readLine() == null)
  54.                 {
  55.                     return;
  56.                 }
  57.             }
  58.  
  59.             // get rid of the "at "
  60.             str    = reader.readLine().trim();
  61.             i      = str.indexOf('.');
  62.             method = str.substring(i + 1);
  63.             clazz  = str.substring(0, i);
  64.         }
  65.         catch(Throwable ex)
  66.         {
  67.         }
  68.     }
  69. }